#include "RoadBuilder.h"

RoadBuilder::RoadBuilder()
{
	m_Contour=0;
	m_CenterLine=(0);
	m_RoadSideLine=(0);
	m_LandFace=(0);
	m_RoadEntity=(0);
	m_HorizonLayout=(0);
	m_VerticalLayout=(0);
	m_MaterialLayout=(0);
}

RoadBuilder::~RoadBuilder()
{
}
bool RoadBuilder::BuildLayers(CVirtualDatabase* pdb)
{
	dmDbDatabase* db=dmDbDatabase::SafeDownCast(pdb);
	if(!pdb) return 0;
	if(db->DeleteLayer(db->GetActiveLayer()->GetName())) return 0;
	m_Contour=db->InsertLayer(s_contour);
	m_CenterLine=db->InsertLayer(s_centerline);
	m_RoadSideLine=db->InsertLayer(s_sideline);
	m_LandFace=db->InsertLayer(s_topoface);
	m_RoadEntity=db->InsertLayer(s_roadentity);
	m_HorizonLayout=db->InsertLayout(s_crossdrawing);
	m_VerticalLayout=db->InsertLayout(s_longtidrawing);
	m_MaterialLayout=db->InsertLayout(s_roadtexture);
	db->SetActiveLayer(m_Contour);
	return 1;
}